// praxis/services/machine_simulator.h
#pragma once

#include <praxis/praxis_export.h>

#include <functional>
#include <memory>
#include <nlohmann/json.hpp>

namespace praxis {
using nlohmann::json;
using StateObserver = std::function<void(const json&)>;

class PRAXIS_API MachineSimulator {
 public:
  explicit MachineSimulator(const json& machine_schema);
  ~MachineSimulator();

  MachineSimulator(const MachineSimulator&) = delete;
  MachineSimulator& operator=(const MachineSimulator&) = delete;

  void RegisterObserver(StateObserver observer);
  void Update();

 private:
  struct Impl;
  std::unique_ptr<Impl> impl_;
};
}  // namespace praxis
